import Vue from 'vue'
import VueRouter from 'vue-router'



Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import("@/views/LoginView.vue")
  },
  {
    path: '/home',
    name: 'home',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/HomeView.vue'),
    children: [
      {
        path: "index",
        component: () => import("@/views/IndexView.vue")
      },
      {
        path: "includetype",
        component: () => import("@/views/IncludeType.vue")
      },
      {
        path: "includetag",
        component: () => import("@/views/IncludeTag.vue")
      },
      {
        path: "type",
        component: () => import("@/views/TypeView.vue")
      },
      {
        path: "tag",
        component: () => import("@/views/TagView.vue")
      },
      {
        path: "file",
        component: () => import("@/views/FileView.vue")
      },
      {
        path: "detail",
        component: () => import("@/views/DetailView.vue")
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
